/*
	File:		DestroyEntityMessage.cpp
	Course:		SGD 1301
	Author:		dmonroe
	Purpose:	Message to remove an entity from the Entity Manager
*/

#include "DestroyEntityMessage.h"
#include "Entity.h"
#include <cassert>


////////////////////////////////////////////////////////////
// CONSTRUCTOR
CDestroyEntityMessage::CDestroyEntityMessage( CEntity* pEntity )
	: CMessage( MSG_DESTROY_ENTITY )
{
	// Validate the parameter
	assert( pEntity != nullptr && "CDestroyEntityMessage::CDestroyEntityMessage - parameter is null" );


	// Store the parameter
	m_pEntity = pEntity;
	m_pEntity->AddRef();
}


////////////////////////////////////////////////////////////
// DESTRUCTOR
CDestroyEntityMessage::~CDestroyEntityMessage(void)
{
	// Release the entity
	m_pEntity->Release();
	m_pEntity = nullptr;
}
